package com.example.dbmysql.result;


import lombok.Data;

@Data
public class PageResult<T> {

    private int code;
    private String msg;
    private T data;
    private long total;
    private Integer page;
    private Integer pageSize;


    public PageResult(int code, String msg, T data,long total, Integer page, Integer pageSize) {
        this.code = code;
        this.total = total;
        this.msg = msg;
        this.data = data;
        this.page = page;
        this.pageSize = pageSize;
    }


    public static <E> PageResult<E> success(E data, long total,Integer page, Integer pageSize) {
        return new PageResult<>(0, "操作成功", data,total, page, pageSize);
    }
}
